package threaddemo;

public class MyTicket implements Runnable{
    private int ticket =100;

    @Override
    public void run() {
        while (true){
            if(ticket <=0)break;
            ticket--;
            System.out.println(Thread.currentThread().getName()+"，还有"+ticket+"张票！");

        }
    }
}
